cc.PropertyTo = cc.Class({
  name: 'cc.PropertyTo',
  extends: cc.ActionInterval,
  
  ctor: function (duration, componentName, propertyName, toValue) {
    this._componentName = '';
    this._propertyName = '';
    this._startValue = 1;
    
    this._endValue = 0;
    
    this._delta = 0;
    
    toValue !== undefined && cc.PropertyTo.prototype.initWithDuration.call(this, duration, componentName, propertyName, toValue);
  },
  
  
  initWithDuration: function (duration, componentName, propertyName, toValue) { //function overload here
    this._componentName = componentName;
    this._propertyName = propertyName;
    if (cc.ActionInterval.prototype.initWithDuration.call(this, duration)) {
      this._endValue = toValue;
      return true;
    }
    return false;
  },
  
  clone: function () {
    let action = new cc.PropertyTo();
    this._cloneDecoration(action);
    action.initWithDuration(this._duration, this._propertyName, this._endValue);
    return action;
  },
  
  startWithTarget: function (target) {
    cc.ActionInterval.prototype.startWithTarget.call(this, target);
    this._targetComponent = target.getComponent(this._componentName);
    this._startValue = this._targetComponent[this._propertyName];
    this._delta = this._endValue - this._startValue;
  },
  
  update: function (dt) {
    dt = this._computeEaseTime(dt);
    if (this._targetComponent) {
      this._targetComponent[this._propertyName] = this._startValue + this._delta * dt;
      
    }
  }
});

cc.propertyTo = function (duration, componentName, propertyName, toValue) { //function overload
  return new cc.PropertyTo(duration, componentName, propertyName, toValue);
};